package com.wjy.game;

import com.wjy.game.viewer.ManagerViewer;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author wjy
 * @date 2025/5/19 17:04
 * @description TODO
 */
@Slf4j
@MapperScan("com.wjy.game.mapper")
@SpringBootApplication
public class ServerStarter {

    public static void main(String[] args) {
        // 设置 java.awt.headless 属性为 false
        System.setProperty("java.awt.headless", "false");
        /*SpringApplication application =
            new SpringApplicationBuilder(Server.class).web(WebApplicationType.NONE).main(Server.class).build(args);
        application.run(args);
        log.info("启动成功");*/
//        MultiClientServer chessServer = new MultiClientServer();
        ConfigurableApplicationContext context = SpringApplication.run(ServerStarter.class, args);
        ManagerViewer viewer = context.getBean(ManagerViewer.class);
        viewer.initUI();
    }
}
